home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 101-125 / scopedisk102 / kdlib / lattice.test.c < prev    next >
C/C++ Source or Header  |  1995-03-19  |  1KB  |  64 lines

  1.  
  2. /*
  3.  *  kd_freq.library Test  for Lattice
  4.  */
  5.  
  6. #include "KDBase.h"
  7.  
  8. UBYTE directory[128];
  9. UBYTE filename[32];
  10. UBYTE pattern[32];
  11.  
  12. struct Library *KD_FReqBase;
  13.  
  14. struct ExtraData extras;
  15.  
  16.  
  17. /* FReq() prototype */
  18.  
  19. ULONG FReq(struct Screen *, UBYTE *, UBYTE *, UBYTE *, 
  20.             UBYTE *, ULONG, struct ExtraData *);
  21.  
  22. void main()
  23.     {
  24.     KD_FReqBase = OpenLibrary(KLIBNAME,KLIBVERSION);
  25.  
  26.     if (KD_FReqBase) 
  27.         {
  28.         /* Make sure that all default strings are zero'd out. */
  29.         directory[0] = filename[0] = pattern[0] = 0;
  30.  
  31.         /* Set default wildcard pattern */
  32.         /* strcpy(pattern,"#?.?"); */
  33.  
  34.         /* Call file requester */
  35.  
  36.         extras.oktext     = (UBYTE *) "Load";
  37.         extras.canceltext = (UBYTE *) "No Way!";
  38.  
  39.         if (FReq(NULL,"Test of 'kd_freq.library'",
  40.             filename,directory,pattern, FR_CANCELTEXT |
  41.             FR_OKTEXT | FR_AUTOPOSITION | FR_AUTOSIZE | FR_NOINFO | FR_SCREENFONT
  42.             ,&extras))
  43.             {    
  44.             /* You can immediately strcat(directory,filename); since
  45.                 directory will contain the valid file seperator (either
  46.                 \ or : at the end of the directory name
  47.             */
  48.  
  49.             puts(directory);
  50.             puts(filename);
  51.             }
  52.         else
  53.             {
  54.             puts("Requester Cancelled!");
  55.             }
  56.  
  57.         CloseLibrary(KD_FReqBase);
  58.             }
  59.      else 
  60.         {
  61.         puts("Can't Open 'kd_freq.library'.  Make sure it is in LIBS:");
  62.         }
  63.     }
  64.